package com.china08.yxyapi.repository.mg;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.transaction.annotation.Transactional;

import com.china08.yxyapi.entity.mg.platform.YxyHomeSlider;

public interface YxyHomeSliderRepository extends MongoRepository<YxyHomeSlider, String> {

    List<YxyHomeSlider> findByEdbIdAndStatusOrderByOrderNumDesc(String eduId, int i);

    @Modifying
    @Transactional
    void deleteByIdAndEdbId(String sliderId, String eduId);

    YxyHomeSlider findByIdAndEdbId(String id, String eduId);

    List<YxyHomeSlider> findTop5ByEdbIdAndStatusOrderByOrderNumDesc(String schoolId, int i);

    Integer countByEdbIdAndStatus(String eduId, Integer status);

    YxyHomeSlider findTop1ByEdbIdOrderByOrderNumDesc(String eduId);

    YxyHomeSlider findByEdbIdAndOrderNum(String schoolId, Integer num);

}
